package concept.misc;

class Test
{
	protected void finalize()
	{
		try
		{
			System.out.println("Test starts!");
			super.finalize();
			System.out.println("Test ends!");
		}
		catch (Throwable e)
		{
			e.printStackTrace();
		}
	}
}

public class GarbageCollectionLab
{
	static void doFinalize()
	{
		Test t = new Test();
		t.finalize();
		System.out.println("Carry on after t.finalize()!");
	}
	public static void main(String[] args)
	{
		doFinalize();
	}

}
